function showCalculator() {
    $(".calculatorbody").css("display", "block");
}
function closeCalculator() {
    $(".calculatorbody").css("display", "none");
}

var results = "";
//显示
function calculator(keyPress){
    console.log("keyPress" + $(keyPress).text());
    results += $(keyPress).text();
    console.log("resulets : " + results);
    $("#calculatorscreen").text(results);
}
//计算
function resultsCalculate(){
    cal = eval(results);
    $("#calculatorscreen").text(cal + "");
}
//清屏
function clearCtx(){
    results = "";
    $("#calculatorscreen").text("");
}



/*(function() {
    function Code() {}
    Code.prototype = {
        addEvent: function() {
            var that = this;
            var oDiv = document.getElementById('draggable');
            oDiv.onmousedown = function(ev) {
                var ev = ev || event;
                var distanceX = ev.clientX - this.offsetLeft;
                var distanceY = ev.clientY - this.offsetTop;
                if (oDiv.setCapture) {
                    oDiv.setCapture();
                }
                document.onmousemove = function(ev) {
                    var ev = ev || event;
                    oDiv.style.left = ev.clientX - distanceX + 'px';
                    oDiv.style.top = ev.clientY - distanceY + 'px';
                };
                document.onmouseup = function(ev) {
                    document.onmousemove = document.onmouseup = null;
                    if (oDiv.releaseCapture) {
                        oDiv.releaseCapture();
                    }
                };
            };
        },

        init: function() {
            var that = this;
            window.onload = that.addEvent;
        },
    }
    new Code().init();
})();*/
